﻿using Sunboxsoft.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Entity = Sunboxsoft.ASMS.Server.Domain.Entity;
using Service = Sunboxsoft.ASMS.Server.Domain.Service;

namespace Sunboxsoft.ASMS.Web.ApiControllers
{
    public class DeleteController : ApiController
    {
        [HttpPost]
        public ServiceResult PayItem(GuidIdParams @params)
        {
            return new Service.DeleteService().DeletePayItem(@params.Id);
        }

        [HttpPost]
        public ServiceResult PayItemArray(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeletePayItemArray(@params.IdArray);
        }

        [HttpPost]
        public ServiceResult Package(GuidIdParams @params)
        {
            return new Service.DeleteService().DeletePackage(@params.Id);
        }

        [HttpPost]
        public ServiceResult PackageArray(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeletePackageArray(@params.IdArray);
        }

        [HttpPost]
        public ServiceResult Business(GuidIdParams @params)
        {
            return new Service.DeleteService().DeleteBusiness(@params.Id);
        }

        [HttpPost]
        public ServiceResult BusinessArray(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeleteBusinessArray(@params.IdArray);
        }

        [HttpPost]
        public ServiceResult Station(GuidIdParams @params)
        {
            return new Service.DeleteService().DeleteStation(@params.Id);
        }

        [HttpPost]
        public ServiceResult StationArray(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeleteStationArray(@params.IdArray);
        }

        [HttpPost]
        public ServiceResult Supplier(GuidIdParams @params)
        {
            return new Service.DeleteService().DeleteSupplier(@params.Id);
        }

        [HttpPost]
        public ServiceResult SupplierMany(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeleteSupplierMany(@params.IdArray);
        }


        [HttpPost]
        public ServiceResult Warehouse(GuidIdParams @params)
        {
            return new Service.DeleteService().DeleteWarehouse(@params.Id);
        }

        [HttpPost]
        public ServiceResult WarehouseArray(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeleteWarehouseArray(@params.IdArray);
        }

        [HttpPost]
        public ServiceResult ServiceItem(GuidIdParams @params)
        {
            return new Service.DeleteService().DeleteServiceItem(@params.Id);
        }

        [HttpPost]
        public ServiceResult ServiceItemArray(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeleteServiceItemArray(@params.IdArray);
        }


        [HttpPost]
        public ServiceResult Material(GuidIdParams @params)
        {
            return new Service.DeleteService().DeleteMaterial(@params.Id);
        }

        [HttpPost]
        public ServiceResult MaterialMany(GuidIdArrayParams @params)
        {
            return new Service.DeleteService().DeleteMaterialMany(@params.IdArray);
        }
    }

    public class GuidIdParams
    {
        public Guid Id { get; set; }
    }
    public class GuidIdArrayParams
    {
        public Guid[] IdArray { get; set; }
    }
}
